package com.framework.utils;

import java.math.BigDecimal;

/**
 * 功能描述:
 *
 * @author ck
 * @date 2018/11/7 20:58
 */
public class BigDecimalUtils {

	//计算代理商之前费率差额 不能有负数
	public static BigDecimal diffRate(BigDecimal param1,BigDecimal param2){
		BigDecimal diff = param1.subtract(param2);
		if(diff.signum() == -1){ //负数
			return new BigDecimal(0.00);
		}else{
			return diff;
		}
	 }

	public static void main(String[] args) {
		BigDecimal  s = new BigDecimal("10");
		BigDecimal  b = new BigDecimal("2");

		System.out.print(s.add(b));
		System.out.print(s);
	}
}
